#include <stdio.h>
void bubbleSort(int *p,int c);
int main(){
	int c = 0;
	scanf("%d",&c);
	printf("%d",c);
	int arr[c];
	for (int i = 0; i < c; ++i) {
		scanf("%d",&arr[i]);
	}
	bubbleSort(arr,c);
	for (int i = 0; i < c; ++i) {
		printf("%d ",arr[i]);
	}
	return 0;
}
void bubbleSort(int *p,int c){
	for (int i = 1; i <= c-1; ++i) {
		for (int j = c-1; j >= i; ++j) {
			if(p[j-1] > p[j]){
				int t;
				t = *(p+j-1);
				*(p+j-1) = *(p+j);
				*(p+j) = t;
			}
		}
	}
}
